import Vue from 'vue'
import App from './App'
import http from './network/index.js'
import https from './network/https.js'
import axios from 'axios'


axios.defaults.adapter = function(config) {
    return new Promise((resolve, reject) => {
        console.log(config)
        var settle = require('axios/lib/core/settle');
        var buildURL = require('axios/lib/helpers/buildURL');
        uni.request({
            method: config.method.toUpperCase(),
            url: config.baseURL + buildURL(config.url, config.params, config.paramsSerializer),
            header: config.headers,
            data: config.data,
            dataType: config.dataType,
            responseType: config.responseType,
            sslVerify: config.sslVerify,
            complete: function complete(response) {
                response = {
                    data: response.data,
                    status: response.statusCode,
                    errMsg: response.errMsg,
                    header: response.header,
                    config: config
                };

                settle(resolve, reject, response);
            }
        })
    })
}
Vue.prototype.$https = https
Vue.prototype.$http = http


import cover from './pages/cover/home.vue'
Vue.component('cover',cover)

import mycenter from './pages/mycenter/mycenter.vue'
Vue.component('mycenter',mycenter)

import upload from './pages/upload/upload.vue'
Vue.component('upload',upload)

import textUpload from './pages/textUpload/textUpload.vue'
Vue.component('textUpload',textUpload)

import basics from './pages/basics/home.vue'
Vue.component('basics',basics)

import components from './pages/component/home.vue'
Vue.component('components',components)

import plugin from './pages/plugin/home.vue'
Vue.component('plugin',plugin)

import cuCustom from './colorui/components/cu-custom.vue'
Vue.component('cu-custom',cuCustom)


Vue.config.productionTip = false

App.mpType = 'app'

const app = new Vue({
    ...App
})
app.$mount()

 



